#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int removeDuplicates(int*nums,int size)
{
	int scr = 0;
	int dest = 0;
	while (scr < size)
	{
		if (nums[scr] != nums[dest])
		{
			dest++;
			nums[dest] = nums[scr];
		}
		else
			scr++;
	}
	return dest;
}
int main()
{
	int a[10] = { 0,1,2,2,2,2,3,4,4,5};
	int size = sizeof(a) / sizeof(a[0]);
	removeDuplicates(a, size);
	return 0;
}